﻿using System.IO;

namespace Com.VikingErik.Mvc.ResumingDownloads
{
    public class ResumableFileContentResult : ResumableDownloadResult
    {
        private byte[] FileContents { get; set; }

        public ResumableFileContentResult(ResumableDownloadRequest resumableDownloadRequest, byte[] fileContents)
            : base(resumableDownloadRequest)
        {
            FileContents = fileContents;
        }

        public ResumableFileContentResult(ResumableDownloadRequest resumableDownloadRequest, byte[] fileContents, string contentType)
            : base(resumableDownloadRequest, contentType)
        {
            FileContents = fileContents;
        }

        protected override System.IO.Stream FileContent
        {
            get
            {
                return new MemoryStream(FileContents, false);
            }
        }
    }
}
